# coding=utf-8
# 简化变量类型标注
a: int = 10
b: str = "hello"
c: float = 3.14
d: bool = True
e: bytes = b"world"

# 复杂类型
from typing import List, Set, Dict, Tuple

x: List[int] = [1, 3, 4]
y: Set[str] = {"ab", "cd"}
z: Dict[str, str] = {"name": "jhon", "sex": "male"}
h: Dict[str, object] = {"name": "jhon", "sex": "male", "age": 20}
j: Tuple[int] = (3,)
k: Tuple[int, int, int] = (3, 4, 5)
l: Tuple[int, str, float] = (3, "name", 5.1)
# 定义可变大小的元组，使用省略号
m: Tuple[int, ...] = (2, 3, 4, 5)

# 3.10新特性可以直接使用 list,tuple,dict,set
n: list[str] = ["a", "b", "c"]
q: tuple[int] = (2,)
p: tuple[int, int] = (2, 3)
# 定义可变大小的元组，使用省略号
i: tuple[int, ...] = (2, 3, 4, 5)
f: set[str] = {"aa", "bb", "cc"}
u: dict[str, object] = {"k1": 1, "k2": "aa", "k3": True}
